package com.devicemantra.coordinate.dao;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import com.google.gson.annotations.Expose;

@Entity
@Table(name = "settings", uniqueConstraints = { @UniqueConstraint(columnNames = { "eppd_friendly_name" }) })
public class Settings {

	private Long id;
	@Expose
	private String friendlyName;
	@Expose
	private String eppdIp;
	@Expose
	private String eppdPort;
	@Expose
	private String eppdUsername;
	@Expose
	private String eppdPassword;
	@Expose
	private String pcksFileName;
	@Expose
	private String jksFileName;
	@Expose
	private String extensions;

	private byte[] pcksFileBytes;
	private byte[] jksFileBytes;

	public Settings() {
	}

	@Id
	@GeneratedValue
	@Column(name = "settings_id")
	public Long getId() {
		return id;
	}

	@Column(name = "eppd_friendly_name", nullable = false)
	public String getFriendlyName() {
		return friendlyName;
	}

	public void setFriendlyName(final String friendlyName) {
		this.friendlyName = friendlyName;
	}

	public void setId(final Long id) {
		this.id = id;
	}

	@Column(name = "eppd_ip", nullable = false)
	public String getEppdIp() {
		return eppdIp;
	}

	public void setEppdIp(final String eppdIp) {
		this.eppdIp = eppdIp;
	}

	@Column(name = "eppd_port", nullable = false)
	public String getEppdPort() {
		return eppdPort;
	}

	@Column(name = "eppd_pcks_filename", nullable = false)
	public String getPcksFileName() {
		return pcksFileName;
	}

	public void setPcksFileName(final String eppdPCKSFileName) {
		this.pcksFileName = eppdPCKSFileName;
	}

	@Column(name = "eppd_jks_filename", nullable = false)
	public String getJksFileName() {
		return jksFileName;
	}

	public void setJksFileName(final String eppdJKSFileName) {
		this.jksFileName = eppdJKSFileName;
	}

	public void setEppdPort(final String eppdPort) {
		this.eppdPort = eppdPort;
	}

	@Column(name = "eppd_username", nullable = false)
	public String getEppdUsername() {
		return eppdUsername;
	}

	public void setEppdUsername(final String eppdUsername) {
		this.eppdUsername = eppdUsername;
	}

	@Column(name = "eppd_password", nullable = false)
	public String getEppdPassword() {
		return eppdPassword;
	}

	public void setEppdPassword(final String eppdPassword) {
		this.eppdPassword = eppdPassword;
	}

	@Column(name = "eppd_jks_file", nullable = false)
	public void setJksFileBytes(final byte[] jksFileBytes) {
		this.jksFileBytes = jksFileBytes;
	}

	public byte[] getJksFileBytes() {
		return jksFileBytes;
	}

	@Column(name = "eppd_pcks_file", nullable = false)
	public void setPcksFileBytes(final byte[] pcksFileBytes) {
		this.pcksFileBytes = pcksFileBytes;
	}

	public byte[] getPcksFileBytes() {
		return pcksFileBytes;
	}

	@Column(name = "eppd_extensions", nullable = false)
	public void setExtensions(final String extensions) {
		this.extensions = extensions;
	}

	public String getExtensions() {
		return extensions;
	}

	/*
	 * public void setEppExtensions(final List<EPPExtension> eppExtensions) {
	 * this.eppExtensions = eppExtensions; }
	 */

	/*
	 * @OneToMany(cascade = CascadeType.ALL)
	 * 
	 * @JoinTable(name = "epp_settings_extensions", joinColumns = {
	 * 
	 * @JoinColumn(name = "settings_id") }, inverseJoinColumns = {
	 * 
	 * @JoinColumn(name = "extension_id") }) public List<EPPExtension>
	 * getEppExtensions() { return eppExtensions; }
	 */

}
